from django.template import Library
from django.conf import settings

register = Library()

@register.inclusion_tag('tag/nb_menu.html')
def nb_menu(request):
    #1.读取当前用户的角色信息
    print(request.userinfo.role)

    #2.菜单信息
    user_menu_list = settings.NB_MENU[request.userinfo.role]
    #
    print(user_menu_list)
    return {'menu_list':user_menu_list}
    # return {'v1':['sharon','jerry','alex']}